package main

import "gitee.com/dark.H/dark"

func main() {
	tmp := `POST /mcp/pc/pcsearch HTTP/1.1
	Host: ug.baidu.com
	Cookie: BIDUPSID=A6DF8E5361702094680A45425EDB2358; PSTM=1667487910; BAIDUID=A6DF8E5361702094209A795B360661B2:FG=1; BA_HECTOR=0dah8la40k0l8ka12hak0k2f1hm7m561f; BAIDUID_BFESS=A6DF8E5361702094209A795B360661B2:FG=1; ZFY=:AZOQCWMUbctrEQG9rMHB1SyTk4TmCPHBZIjgGS6dQVE:C; BDRCVFR[S4-dAuiWMmn]=I67x6TjHwwYf0; delPer=0; PSINO=5; H_PS_PSSID=36551_37687_37584_36885_37486_36805_36789_37533_37500_26350; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598
	Content-Length: 56
	Sec-Ch-Ua: "Chromium";v="107", "Not=A?Brand";v="24"
	Sec-Ch-Ua-Platform: "Windows"
	Sec-Ch-Ua-Mobile: ?0
	User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.5304.63 Safari/537.36
	Content-Type: application/json
	Accept: */*
	Origin: https://www.baidu.com
	Sec-Fetch-Site: same-site
	Sec-Fetch-Mode: cors
	Sec-Fetch-Dest: empty
	Referer: https://www.baidu.com/s?wd=%E5%B7%B4%E5%9F%BA%E6%96%AF%E5%9D%A6%E5%89%8D%E6%80%BB%E7%90%86%E9%81%AD%E6%9E%AA%E5%87%BB+%E9%80%81%E5%8C%BB%E7%94%BB%E9%9D%A2%E6%9B%9D%E5%85%89&sa=fyb_n_homepage&rsv_dl=fyb_n_homepage&from=super&cl=3&tn=baidutop10&fr=top1000&rsv_idx=2&hisfilter=1
	Accept-Encoding: gzip, deflate
	Accept-Language: zh-CN,zh;q=0.9
	Connection: close
	
	{"invoke_info":{"pos_1":[{}],"pos_2":[{}],"pos_3":[{}]}}`
	netStr := dark.Str(tmp).AsNetReq()
	// netStr.Header().Every(func(k string, v dark.Str) {
	// 	v.ANSIBold().ANSIYellow().Println(k)
	// })
	netStr = netStr.SetUri("/test/asdfcheck")
	netStr.Println("test set uri")
	netStr.Cookie().Every(func(k string, v dark.Str) {
		v.ANSIGreen().Println(dark.Str(k).Color("y"))
	})
	netStr = netStr.SetCookie("test-cookie", "checked!")
	body := netStr.Body()
	netStr.SetHead("User-Agent", "Hello").ANSIGreen().Replace(body.Str(), string(body.Color("y", "F").Str())).Println("PAY")

}
